﻿<?php
	session_start();
	error_reporting (E_ALL ^ E_NOTICE);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>ADDIVITY</title>
		<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
		<link href="css/jquery.ennui.contentslider.css" rel="stylesheet" type="text/css" media="screen,projection" />
	</head>
	<body>
		<div id="templatemo_header_wrapper">
			<div id="templatemo_header">
				<div id="site_title">
					<h1>
						<a href="" target="_parent">
							<img src="images/logo.jpg" alt="Logo" />
							<!-- <span>free website templates</span> -->
						</a>
					</h1>
				</div>
				<div id="search_box">
					<?php include("./module/login_top.php"); ?>
				</div>
				<div class="cleaner"></div>
			</div>
			<div id="templatemo_menu">
				<ul>
					<?php include("./module/menu_ber_top.php"); ?>
				</ul>
			</div>
			<div id="templatemo_banner">
				<div id="one" class="contentslider">
					<div class="cs_wrapper">
						<div class="cs_slider">
							<?php
								include("./config/conn_database.php");
								$strSQL = "SELECT * FROM add_activity  ORDER BY act_date_end ASC ";
								$objQuery = mysql_query($strSQL);
								while($objResult = mysql_fetch_array($objQuery)){									
									echo "<div class='cs_article'>";
									echo "<div class='left'>";
									echo "<h2>".$objResult['act_ref']."</h2>";
									echo "<p>".$objResult['act_ref']."</p>";
									echo "<div class='button'><a href='".$objResult['act_ref']."' title='".$objResult['act_topic']."' target='_blank'>Read more</a></div>";
									echo "</div>";
									echo "<div class='right'>";
									echo "<a href='".$objResult['act_ref']."' title='".$objResult['act_topic']."' target='_blank'><img src='./images/act_news/".$objResult['act_image']."' alt='".$objResult['act_topic']."' /></a>";
									echo "</div>";
									echo "</div>";
								}
							?>
						</div>
					</div>
				</div>
				<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
				<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
				<script type="text/javascript" src="js/jquery.ennui.contentslider.js"></script>
				<script type="text/javascript">
					$(function() {
						$('#one').ContentSlider({
							width : '920px',
							height : '200px',
							speed : 800,
							easing : 'easeInOutBack'
						});
					});
				</script>
				<script src="js/jquery.chili-2.2.js" type="text/javascript"></script>
				<script src="js/chili/recipes.js" type="text/javascript"></script>
				<div class="cleaner"></div>
			</div>
		</div>
		<div id="templatemo_content_wrapper_outer">
			<div id="templatemo_content_wrapper_inner">
				<div id="templatemo_content_wrapper">
					<div id="templatemo_content">
						<?php 
							$strSQL = "SELECT * FROM add_idea";
							$objQuery = mysql_query($strSQL);
							while($objResult = mysql_fetch_array($objQuery)){
								echo "<br />";
								echo "<h2>".$objResult['idea_topic']."</h2>";
								echo "<p>".$objResult['idea_detail']."</p>";
							}
						?>
						<div class="cleaner_h40"></div>
						<?php
							$strSQL = "SELECT * FROM add_news";
							$objQuery = mysql_query($strSQL);
							while($objResult = mysql_fetch_array($objQuery)){
								echo "<h2>".$objResult['news_topic']."</h2>";
								$yy = (substr($objResult['news_date'], 0, 4)+543);
								$mm = substr($objResult['news_date'], 4, 2);
								switch($mm){
									case 01 : $strMM = "ม.ค."; break;
									case 02 : $strMM = "ก.พ."; break;
									case 03 : $strMM = "มี.ค."; break;
									case 04 : $strMM = "เม.ย."; break;
									case 05 : $strMM = "พ.ค."; break;
									case 06 : $strMM = "มิ.ย."; break;
									case 07 : $strMM = "ก.ค."; break;
									case 08 : $strMM = "ส.ค."; break;
									case 09 : $strMM = "ก.ย."; break;
									case 10 : $strMM = "ต.ค."; break;
									case 11 : $strMM = "พ.ย."; break;
									case 12 : $strMM = "ธ.ค."; break;
								}
								$dd = substr($objResult['news_date'], 6, 4);
								$strDate = $dd." ".$strMM." ".$yy;
								echo "<p>".$objResult['news_detail']." - <i>".$strDate."</i><br />";
								echo "<cite>Ref. - <a href='".$objResult['news_ref']."' target='_blank'>".$objResult['news_ref']."</a></cite></p>";
								echo "<br /><br />";
							}
						?>
						<div class="cleaner_h40"></div>
						<h2>Activity</h2>
						<div id="recent_project">
							<ul>
								<?php
									$strSQL = "SELECT * FROM add_activity  ORDER BY act_date_end ASC ";
									$objQuery = mysql_query($strSQL);
									while($objResult = mysql_fetch_array($objQuery)){
										echo "<li>";
										echo "<a href='".$objResult['act_ref']."' title='".$objResult['act_topic']."' target='_blank'><img src='./images/act_news/".$objResult['act_image']."' alt='".$objResult['act_topic']."' /></a><h5>".$objResult['act_plot']."</h5>";
										echo "</li>";
										$i++;
									}
								?>
							</ul>
							<div class="cleaner"></div>
							<div class="button float_l"><a href="#" target="_blank">View All</a></div>
						</div>
					</div>
					<div id="templatemo_sidebar">
						<div id="news_section">
							<?php include("./module/login_from.php"); ?>
							<br /><br /><br />
							<h2>Activity Now</h2>
							<?php include("./module/activity_now.php"); ?>
							<div class="cleaner"></div>  
						</div>
						<div class="section_rss_twitter">
							<?php
								$i=1;
								while($i<7){
									echo "<div class='rss_twitter twitter'>";
									echo "<a href='#' target='_parent'>Banner Name<span>Banner</span></a>";
									echo "</div>";
									echo "<div class='margin_bottom_20'></div>";
									$i++;
								}
							?>
						</div>
						<div class="cleaner"></div>
					</div>
					<div class="cleaner"></div>
				</div>
			</div>
		</div>
		<div id="templatemo_footer_wrapper">
			<div id="templatemo_footer">
				<ul class="footer_menu">
					<?php include("./module/menu_ber_top.php"); ?>
				</ul>
				Copyright © 2048 <a href="#">ADDIVITY</a> | 
				Designed by <a href="http://www.templatemo.com" target="_parent">templatemo.com</a>
			</div>
		</div>
	</body>
</html>
<?php mysql_close($objConnect); ?>
